home *** CD-ROM | disk | FTP | other *** search
/ Workbench Add-On / Workbench Add-On - Volume 1.iso / Dev / ACE / bin / 1.3 / bas next >
AmigaDOS Script File  |  1994-10-22  |  2KB  |  81 lines

  1. .key arg1,arg2,arg3
  2.  
  3. ; ** compile, assemble and link an ACE program **
  4. ;
  5. ; ** NOTE: this Wb 1.3 version of bas only handles
  6. ; ** ACE source files with ".b" - not ".bas" - extensions.
  7.  
  8. ; make sure stack is big enough.
  9. STACK 40000
  10.  
  11. ; don't abort script if ACE or APP quits 
  12. ; with a return code of 10 (ERROR).
  13. FAILAT 11
  14.  
  15. IF <arg2> GT ""
  16.  
  17.  ; at least 2 arguments: <arg1> = compiler options.
  18.  ;             <arg2> = ACE source file.
  19.  ;             <arg3> = extra object module/library to link.
  20.  
  21.  ; preprocess source file.
  22.  app <arg2>.b ram:t/<arg2>.b
  23.  IF NOT ERROR
  24.  
  25.    ; compile preprocessed source file.
  26.    ace <arg1> ram:t/<arg2>
  27.  
  28.    IF NOT ERROR
  29.      ; assemble and link
  30.      delete >NIL: ram:t/<arg2>.b
  31.      a68k ram:t/<arg2>.s 
  32.      delete >NIL: ram:t/<arg2>.s
  33.      blink ram:t/<arg2>.o LIB <arg3>+ACElib:startup.lib+ACElib:db.lib+
  34.                   ACElib:ami.lib SMALLCODE SMALLDATA
  35.  
  36.      ; leave us with the executable (and icon?).
  37.      copy ram:t/<arg2> ""
  38.  
  39.      IF EXISTS ram:t/<arg2>.info
  40.        copy ram:t/<arg2>.info ""
  41.      ENDIF
  42.  
  43.    ENDIF
  44.  
  45.  ENDIF
  46.  
  47. ELSE 
  48.  
  49.  ; no compiler options: <arg1> = ACE source file.
  50.  ;            <arg2> = extra object module/library to link.
  51.  
  52.  app <arg1>.b ram:t/<arg1>.b
  53.  
  54.  IF NOT ERROR
  55.  
  56.    ; compile source file.
  57.    ace ram:t/<arg1>
  58.  
  59.    IF NOT ERROR
  60.      ; assemble and link.
  61.      delete >NIL: ram:t/<arg1>.b
  62.      a68k ram:t/<arg1>.s 
  63.      delete >NIL: ram:t/<arg1>.s
  64.      blink ram:t/<arg1>.o LIB <arg2>+ACElib:startup.lib+ACElib:db.lib+
  65.                        ACElib:ami.lib SMALLCODE SMALLDATA
  66.  
  67.      ; leave us with the executable (and icon?).
  68.      copy ram:t/<arg1> ""
  69.    
  70.      IF EXISTS ram:t/<arg1>.info
  71.        copy ram:t/<arg1>.info ""
  72.      ENDIF
  73.  
  74.    ENDIF
  75.  ENDIF
  76.  
  77. ENDIF
  78.  
  79. ; kill any remaining temporary files.
  80. delete >NIL: ram:t/<arg2>#?
  81.